import request from "@/utils/serviceApiH2";

// 新增招聘会
export function addJobFairApi(data) {
  return request({
    url: "/apiH2/admin/app/jobFair/addJobFair",
    method: "POST",
    data,
    // headers: {
    //   "Content-Type": "multipart/form-data",
    // },
  });
}

// 添加招聘会参会企业
export function addCompanyApi(data) {
  return request({
    url: "/apiH2/admin/app/jobFair/attendCompany/addCompany",
    method: "POST",
    data,
  });
}

// 删除招聘会参会企业
export function delCompanyApi(data) {
  return request({
    url: "/apiH2/admin/app/jobFair/attendCompany/delCompany",
    method: "DELETE",
    data,
  });
}

// 添加招聘会参会企业查询
export function selCompanyApi(params) {
  return request({
    url: "/apiH2/admin/app/jobFair/attendCompany/selCompany",
    method: "GET",
    params,
  });
}

// 修改招聘会参会企业
export function updateCompanyApi(data, audit) {
  return request({
    url: `/apiH2/admin/app/jobFair/attendCompany/updateCompany/${audit}`,
    method: "PUT",
    data,
  });
}

// 添加招聘会参会用户
export function addPersonalApi(data) {
  return request({
    url: "/apiH2/admin/app/jobFair/attendPersonal/addPersonal",
    method: "POST",
    data,
  });
}

// 删除招聘会参会用户
export function delPersonalApi(data) {
  return request({
    url: "/apiH2/admin/app/jobFair/attendPersonal/delPersonal",
    method: "DELETE",
    data,
  });
}

// 添加招聘会参会用户查询
export function selPersonalApi(params) {
  return request({
    url: "/apiH2/admin/app/jobFair/attendPersonal/selPersonal",
    method: "GET",
    params,
  });
}

// 修改招聘会参会用户
export function updatePersonalApi(data, audit) {
  return request({
    url: `/apiH2/admin/app/jobFair/attendPersonal/updatePersonal/${audit}`,
    method: "PUT",
    data,
  });
}

// 删除招聘会
export function delJobFairByIdsApi(data) {
  return request({
    url: "/apiH2/admin/app/jobFair/delJobFairByIds",
    method: "DELETE",
    data,
  });
}

// 招聘会参会企业列表查询
export function selAttendCompanyListApi(params) {
  return request({
    url: "/apiH2/admin/app/jobFair/selAttendCompanyList",
    method: "GET",
    params,
  });
}

// 招聘会参会用户列表查询
export function selAttendPersonalListApi(params) {
  return request({
    url: "/apiH2/admin/app/jobFair/selAttendPersonalList",
    method: "GET",
    params,
  });
}

// 根据id查询招聘会
export function selJobFairByIdApi(id) {
  return request({
    url: `/apiH2/admin/app/jobFair/selJobFairById/${id}`,
    method: "GET",
  });
}

// 招聘会列表查询
export function selJobFairListApi(params) {
  return request({
    url: "/apiH2/admin/app/jobFair/selJobFairList",
    method: "GET",
    params,
  });
}

// 根据id修改招聘会
export function updateJobFairApi(data,id) {
  return request({
    url: `/apiH2/admin/app/jobFair/updateJobFair/${id}`,
    method: "PUT",
    data,
  });
}

// 根据id修改招聘会状态
export function updateJobFairDisplayApi(id) {
  return request({
    url: `/apiH2/admin/app/jobFair/updateJobFairDisplay/${id}`,
    method: "PUT",
  });
}

// 根据uid查询招聘会企业参会职位
export function selJobFairJobByUidApi(params) {
   return request({
     url: `/apiH2/admin/app/selJobFairJobByUid/${params.uid}/${params.jobFairId}`,
     method: "GET",
   });
}


/* 海报 */

// 添加海报
export function addPosterApi(data) {
  return request({
    url: "/apiH2/admin/app/poster/addPoster",
    method: "POST",
    data,
  });
}

// 删除海报
export function delPosterByIdApi(id) {
  return request({
    url: `/apiH2/admin/app/poster/delPosterById/${id}`,
    method: "DELETE",
  });
}

// 海报集合查询
export function selPosterListApi(params) {
  return request({
    url: "/apiH2/admin/app/poster/selPosterList",
    method: "GET",
    params,
  });
}

// 修改海报信息
export function updatePosterByIdApi(data, id) {
  return request({
    url: `/apiH2/admin/app/poster/updatePosterById/${id}`,
    method: "PUT",
    data,
  });
}

// 修改海报状态
export function updatePosterIsDisplayByIdApi(id, isDisplay) {
  return request({
    url: `/apiH2/admin/app/poster/updatePosterIsDisplayById/${id}`,
    method: "PUT",
    params: {
      isDisplay,
    },
  });
}

// 企业视频招聘列表查询
export function selCompanyVideoListApi(params) {
  return request({
    url: "/apiH2/admin/app/companyVideo/selCompanyVideoList",
    method:'GET',
    params
  });
}

// 审核企业视频招聘
export function updateCompanyVideoByIdApi(audit,id) {
  return request({
    url: `/apiH2/admin/app/companyVideo/updateCompanyVideoById/${id}`,
    method: "PUT",
    params: {
      audit
    }
  });
}

// 删除企业视频招聘
export function delCompanyVideoByIdApi(id) {
  return request({
    url: `/apiH2/admin/app/companyVideo/delCompanyVideoById/${id}`,
    method:'DELETE'
  });
}

// 根据招聘会id导出企业职位信息
export function exportExcelApi(id) {
  return request({
    url: `/apiH2/admin/excel/exportExcel/${id}`,
    method: "GET",
  });
}
